let arr=[1,2,3,4,10,40,20,1000,200,300,0,-1,-2];
//从小到大
arr.sort(function(a,b){
    return a-b;
});
console.log(arr);
//从大到小
arr.sort(function(){
    return -0.5;
})
console.log(arr);
//随即打乱顺序
arr.sort(function(){
    return Math.random()-0.5;
})
console.log(arr);
//箭头函数
arr.sort(()=>Math.random()-0.5);
console.log(arr);

let test=function(x="Hello",y="World",z){
    console.log(x);
    console.log(y);
    console.log(z);
}
test({z:"abc"});

new test({"X":1234,"y":1,"z":134});